/**
 * Oregon Scientific WMR100/200/WMRS200/I300/I600/RMS600 protocol. Tested on wmrs200.
 *
 * Copyright:
 * 2009 Barnaby Gray <barnaby@pickle.me.uk>
 * 2012 Den68 <idg68@yandex.ru> 
 * Latest download URL: http://www.nkl.ru/support/wmr/
 * Global download URL: http://code.google.com/p/wmr/
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#define WMR_RRD_OUT_FILE		"%s/%s_%d.rrd"
#define WMR_RRD_UPDATE_FILE		"%s update %s/%s_%d.rrd --template %s"

static char *const WMR_RRD_CREATE[] = { \
"%s create %s/%s_%d.rrd --step 150 DS:Temp:GAUGE:240:-50:150 DS:DewPoint:GAUGE:240:-50:150 DS:Humidity:GAUGE:240:0:100 RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:15:2880 RRA:AVERAGE:0.5:120:2160 RRA:AVERAGE:0.5:720:1440 RRA:MIN:0.5:1:4320 RRA:MIN:0.5:15:2880 RRA:MIN:0.5:120:2160 RRA:MIN:0.5:720:1440 RRA:MAX:0.5:1:4320 RRA:MAX:0.5:15:2880 RRA:MAX:0.5:120:2160 RRA:MAX:0.5:720:1440 RRA:LAST:0.5:1:4320 RRA:LAST:0.5:15:2880 RRA:LAST:0.5:120:2160 RRA:LAST:0.5:720:1440", \
"%s create %s/%s_%d.rrd --step 150 DS:Pressure:GAUGE:240:700:800 DS:PressureAlt:GAUGE:240:700:800 RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:15:2880 RRA:AVERAGE:0.5:120:2160 RRA:AVERAGE:0.5:720:1440 RRA:MIN:0.5:1:4320 RRA:MIN:0.5:15:2880 RRA:MIN:0.5:120:2160 RRA:MIN:0.5:720:1440 RRA:MAX:0.5:1:4320 RRA:MAX:0.5:15:2880 RRA:MAX:0.5:120:2160 RRA:MAX:0.5:720:1440 RRA:LAST:0.5:1:4320 RRA:LAST:0.5:15:2880 RRA:LAST:0.5:120:2160 RRA:LAST:0.5:720:1440", \
"%s create %s/%s_%d.rrd --step 150 DS:Wind:GAUGE:240:0:200 DS:WindAwg:GAUGE:240:0:200 RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:15:2880 RRA:AVERAGE:0.5:120:2160 RRA:AVERAGE:0.5:720:1440 RRA:MIN:0.5:1:4320 RRA:MIN:0.5:15:2880 RRA:MIN:0.5:120:2160 RRA:MIN:0.5:720:1440 RRA:MAX:0.5:1:4320 RRA:MAX:0.5:15:2880 RRA:MAX:0.5:120:2160 RRA:MAX:0.5:720:1440 RRA:LAST:0.5:1:4320 RRA:LAST:0.5:15:2880 RRA:LAST:0.5:120:2160 RRA:LAST:0.5:720:1440", \
"%s create %s/%s_%d.rrd --step 150 DS:RainRate:GAUGE:240:0:100 DS:RainHour:GAUGE:240:0:100 DS:RainDay:GAUGE:240:0:100 DS:RainAll:GAUGE:240:0:100 RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:15:2880 RRA:AVERAGE:0.5:120:2160 RRA:AVERAGE:0.5:720:1440 RRA:MIN:0.5:1:4320 RRA:MIN:0.5:15:2880 RRA:MIN:0.5:120:2160 RRA:MIN:0.5:720:1440 RRA:MAX:0.5:1:4320 RRA:MAX:0.5:15:2880 RRA:MAX:0.5:120:2160 RRA:MAX:0.5:720:1440 RRA:LAST:0.5:1:4320 RRA:LAST:0.5:15:2880 RRA:LAST:0.5:120:2160 RRA:LAST:0.5:720:1440", \
"%s create %s/%s_%d.rrd --step 150 DS:Water:GAUGE:240:-50:150 RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:15:2880 RRA:AVERAGE:0.5:120:2160 RRA:AVERAGE:0.5:720:1440 RRA:MIN:0.5:1:4320 RRA:MIN:0.5:15:2880 RRA:MIN:0.5:120:2160 RRA:MIN:0.5:720:1440 RRA:MAX:0.5:1:4320 RRA:MAX:0.5:15:2880 RRA:MAX:0.5:120:2160 RRA:MAX:0.5:720:1440 RRA:LAST:0.5:1:4320 RRA:LAST:0.5:15:2880 RRA:LAST:0.5:120:2160 RRA:LAST:0.5:720:1440", \
"%s create %s/%s_%d.rrd --step 150 DS:UV:GAUGE:240:0:15 RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:15:2880 RRA:AVERAGE:0.5:120:2160 RRA:AVERAGE:0.5:720:1440 RRA:MIN:0.5:1:4320 RRA:MIN:0.5:15:2880 RRA:MIN:0.5:120:2160 RRA:MIN:0.5:720:1440 RRA:MAX:0.5:1:4320 RRA:MAX:0.5:15:2880 RRA:MAX:0.5:120:2160 RRA:MAX:0.5:720:1440 RRA:LAST:0.5:1:4320 RRA:LAST:0.5:15:2880 RRA:LAST:0.5:120:2160 RRA:LAST:0.5:720:1440", \
"%s create %s/%s_%d.rrd --step 150 DS:MainBattery:GAUGE:240:0:1 DS:ExtPower:GAUGE:240:0:1 DS:Level:GAUGE:240:0:100 RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:15:2880 RRA:AVERAGE:0.5:120:2160 RRA:AVERAGE:0.5:720:1440 RRA:MIN:0.5:1:4320 RRA:MIN:0.5:15:2880 RRA:MIN:0.5:120:2160 RRA:MIN:0.5:720:1440 RRA:MAX:0.5:1:4320 RRA:MAX:0.5:15:2880 RRA:MAX:0.5:120:2160 RRA:MAX:0.5:720:1440 RRA:LAST:0.5:1:4320 RRA:LAST:0.5:15:2880 RRA:LAST:0.5:120:2160 RRA:LAST:0.5:720:1440" \
};

static char *const WMR_RRD_UPDATE[] = { \
"Temp:DewPoint:Humidity N:%.1f:%.1f:%d", \
"Pressure:PressureAlt N:%d:%d",\
"Wind:WindAwg N:%.1f:%.1f", \
"RainRate:RainHour:RainDay:RainAll N:%d:%.2f:%.2f:%.2f", \
"Water N:%.1f", \
"UV N:%d", \
"MainBattery:ExtPower:Level N:%d:%d:%d" \
};
